package com.fjxd.feign.clients;

import com.fjxd.feign.fallback.PlaneTicketClientFallbackFactory;
import com.fjxd.feign.pojo.City;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @author csw
 */
@FeignClient(value = "cityservice",fallbackFactory = PlaneTicketClientFallbackFactory.class)
public interface CityClient {
    /**
     * 通过id获取城市信息
     * @param id 城市id
     * @return 返回一个城市对象
     */
    @GetMapping("/city/getCityById/{id}")
    City getCityById(@PathVariable Integer id);

    @GetMapping("/city/getCityAll")
    List<City> getCityAll();

    @GetMapping("/city/getCityIdByName/{cityName}")
    public Integer getCityIdByName(@PathVariable String cityName);

    @GetMapping("/city/getCityIdListByName/{upCity}/{downCity}")
    public List<City> getCityIdListByName(@PathVariable String upCity, @PathVariable String downCity);
}
